<template>
  <div class="article-container">
    <div class="banner">
      <img src="../assets/img/banner2.png" alt="">
      <div class="text-area">
        <span>WE ARE A-SOUL</span>
      </div>
    </div>
    <ul class="article-list">
      <li v-for="item in [...Array(10).keys()]" :key="item">
        <h1>{{ articleItem.title }}</h1>
        <div class="info">
          <div class="comment-date">
            <div class="comment">
              <div class="comment-icon"></div>
              <span>{{ articleItem.commentCount }}</span>
            </div>
            <span>{{ articleItem.date }}</span>
          </div>
          <div class="author">
            <div class="avatar"></div>
            <span>{{ articleItem.author }}</span>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue";

export default defineComponent({
  name: "ArticleShow",
  setup() {
    let articleItem = reactive({
      title: "一个简单的专栏，没有什么内容一个简单的专栏，没有什么内容一个简单的专栏，没有什么内容一个简单的专栏，没有什么内容",
      commentCount: 2,
      date: "2021年1月1日",
      author: "Rella",
      avatar: ""
    });
    return {
      articleItem
    };
  }
});
</script>

<style lang="less" scoped>
.article-container {
  .banner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-height: 120px;
    max-height: 360px;
    width: 100%;
    border-radius: 7px;
    img {
      width: 100%;
    }

    .text-area {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 100%;

      text-align: center;
      padding-top: 18px;
      padding-bottom: 14.5px;
      color: #fff;
      letter-spacing: 0.5em;
      font-size: 12.5px;
      background-color: #6272AA69;
    }
  }

  .article-list {
    list-style: none;

    li {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      margin-top: 28.5px;
      border-bottom: 1px solid rgba(#A8A8A8, .3);


      h1 {
        margin-bottom: 15px;
        font-weight: 400;
        font-size: 14.5px;
        width: 70%;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .info {
        display: flex;
        justify-content: space-between;
        margin-bottom: 15px;

        .comment-date {
          display: flex;
          align-items: center;
          font-size: 10px;
          color: #9FA19F;
          font-family: "ABeeZee", "OPPOSans-M", Microsoft Yahei, Times, serif;

          .comment {
            display: flex;
            align-items: center;
            margin-right: 9px;

            .comment-icon {
              width: 13px;
              height: 13px;
              margin-right: 3px;
              margin-bottom: 2px;
              background: url("../assets/icon/barrage.svg") center/contain no-repeat;
            }
          }
        }

        .author {
          display: flex;
          align-items: center;
          font-size: 8px;

          .avatar {
            width: 17px;
            height: 17px;
            border-radius: 50%;
            margin-right: 4px;
            background: url("../assets/img/avatar.png") center/contain no-repeat;
          }
        }
      }
    }
  }
}
</style>
